package kr.co.gasan.bdt;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 * Item entity.
 */
@Entity
@Table(name="ORDERAPP_ITEM")
@NamedQuery(name="findAllItems", query="select i from Item i")
public class Item implements Serializable {

    /**
	 * 
	 */
	private static final long serialVersionUID = 1754121439812042120L;
	
	private long id;
    private String name;
    private double price;
    
    public Item() {}
    
    public Item(String name, double price){
        this.name = name;
        this.price = price;
    }

    // ---Annotation이 프로퍼티에 달려 있을 경우 Property access type이라 한다.--- //
    @Id 
    @GeneratedValue //DB에 의해서 값이 자동으로 생성되는 필드임을 표시한다.
    public long getId() {return id;}

    public void setId(long id) {this.id = id;}
    
    public String getName(){return name;}
    
    public void setName(String name){this.name = name;}

    public double getPrice() {return price;}

    public void setPrice(double price) {this.price = price;}
}